#!/usr/bin/env python

import sys
import pandas as pd
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt

tsv_path = sys.argv[1]

df = pd.read_csv(tsv_path, sep='\t', names=['timestamp', 'label', 'price'], parse_dates=True)
df['timestamp'] = pd.to_datetime(df['timestamp'])
df = df.set_index('timestamp')

plt.figure(figsize=(100, 50))

groups = df.groupby('label')
fig, ax = plt.subplots(figsize=(100, 50))

ax.margins(0.05)
for name, group in groups:
  print(group)
  ax.plot(group['price'], marker='.', linestyle='', label=name)
ax.legend()

plt.savefig('output.png')
